﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using RegOnline.RegOnlineService;

namespace RegOnline
{
    public class ImageController
    {
        public enum ImageControllerUser
        {
            student, prepod
        }

        public static string GetPict(object obj, ImageControllerUser mode = ImageControllerUser.student )
        {
            if ((obj is UchPlan)&&(mode == ImageControllerUser.student))
            {
                try
                {
                    var v = obj as UchPlan;
                    if (v.Ws.RegNum != null)
                        return "/RegOnline;component/picts/reg.png";
                    else
                        return "/RegOnline;component/picts/notReg.png";
                }
                catch
                    (Exception ex)
                {

                }
                finally
                {

                }
                    
            }

            if ((obj is UchPlan) && (mode == ImageControllerUser.prepod))
            {
                try
                {
                    var v = obj as UchPlan;
                    if (v.rw.Count != 0)
                        return "/RegOnline;component/picts/reg.png";
                    else
                        return "/RegOnline;component/picts/notReg.png";
                }catch(Exception ex)
                {}
            }

            if (obj is ReqsWork)
            {
                try
                {
                    var v = (obj as ReqsWork);

                    if (v.LR.lWs.SistemNum != null)
                        return "/RegOnline;component/picts/reg.png";
                    else
                        return "/RegOnline;component/picts/notReg.png";
                }
                catch (Exception ex)
                {
                }
            }

            return "/RegOnline;component/picts/notReg.png";
        }
    }
}
